package com.monitor.pubInter.exception;


import com.monitor.commons.enums.ExceptionEnum;
import com.monitor.web.common.constant.CodeConstant;

/**
 * @author sunke
 * @Date 2019-09-09 16:31:10
 * @description 业务异常枚举
 */

public enum BusinessExceptionEnum implements ExceptionEnum<BusinessExceptionEnum> {

    SYSTEM_ERROR(CodeConstant.BUSINESS, "system.error", "系统异常"),
    NOT_FIND_PAGE(CodeConstant.BUSINESS + 5, "not.find.page", "该网页无法打开"),
    OBJ_NULL_ERROR(CodeConstant.BUSINESS + 10, "obj.null.error", "对象空"),
    EMPTY_ERROR(CodeConstant.BUSINESS + 15, "empty.error", "空字符"),
    RIGHTS_NO_ERROR(CodeConstant.BUSINESS + 20, "rights.no.error", "无权限操作"),
    TOKEN_NULL(CodeConstant.BUSINESS + 25, "token.null", "token不存在或过期"),
    FILE_FORMAT_ERROR(CodeConstant.BUSINESS + 30, "file.format.error", "文件格式有误"),
    FILE_NULL_ERROR(CodeConstant.BUSINESS + 35, "file.null.error", "文件为空"),
    FILE_UPLOAD_LENGTH_ERROR(CodeConstant.BUSINESS + 36, "file.upload.length.error", "文件上传异常"),
    FILE_TOO_LARGE(CodeConstant.BUSINESS + 37, "file.too.large", "文件大小超过2M"),
    EXIST(CodeConstant.BUSINESS + 40, "EXIST", "已存在"),
    ID_EMPTY(CodeConstant.BUSINESS + 50, "id.empty", "主键为空"),
    ENTITY_EXT_EMPTY(CodeConstant.BUSINESS + 60, "entity.ext.empty", "分页内容对象为空"),
    SERVICE_EMPTY(CodeConstant.BUSINESS + 70, "service.empty", "service为空"),
    PAGE_VO_EMPTY(CodeConstant.BUSINESS + 80, "page.vo.empty", "分页内容包装对象为空"),
    SEARCH_EMPTY(CodeConstant.BUSINESS + 90, "search.empty", " 搜索对象为空"),
    VO_EMPTY(CodeConstant.BUSINESS + 100, "vo.empty", " VO对象为空"),


    GIFT_VOUCHER_CARD_EMPTY(CodeConstant.BUSINESS + 120, "gift.voucher.card.empty", " 礼品卡不存在或已兑换，请联系客服"),

    PRODUCT_ORDER_STATUS_ERROR(CodeConstant.BUSINESS + 130, "product.order.status.error", "订单状态有误"),
    ;


    private int code;
    private String key;

    public void setMessage(String message) {
        this.message = message;
    }

    private String message;

    BusinessExceptionEnum(int code, String key, String message) {
        this.code = code;
        this.key = key;
        this.message = message;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getMessage() {
        return message;
    }





}
